home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Icons don't show up in the menu
- Sent: 6/29/96 9:30 PM
- Received: 7/1/96 8:34 AM
- From: Neal Williams, neal@corda.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >>I have icons in my menu but they don't show up.
- >>
- >>My menus are in a mac resource file and I install them all using the
- >>'MyMenuBar->AddMenuLast()' method, but none of my icons will show.
- >>
- >>Is this because my resource file is out of scope when my menu comes
- >up?
- >
- >Yes. This is also why balloon help for menus doesn't work with OpenDoc.
- >The menu manager doesn't actually load the menus when the menu is
- >created. It loads them when drawing the menu.
- >
- >>How do I get them to show up?
- >
- >You can use the following technique:
- >
- >When you get and AdjustMenus call and you have the menu focus, call
- >BeginUsingLibraryResources (or an equivalent routine if you're using ODF
- >or something else). Store the reference number this call gives you in a
- >field in your class.
-
-
- How can I do this using the ODF class FW_CSharedLibraryResourceFile for
- this? I've only seen it used to set up a scope within a method, not across
- methods.
-
-
-
-
-
-
- >
- >When you get the ensuing HandleEvent with a menu event, call
- >EndUsingLibraryResources resources with that reference value.
- >
- >One of the clipboard recipes makes the statement that you will always
- >get
- >a menu event after an AdjustMenus call, even if the mouse was released
- >outside all the menus. This is done so that you can acquire the
- >clipboard focus in AdjustMenus and not give it up until after the menu
- >event has been handled (so there's no way the clipboard could change on
- >you).
- >
- >However, there's a bug in OpenDoc (I believe it's still incorrect in
- >1.0.4, but it's reportedly fixed in the next version) where this doesn't
- >happen for one case. The case at fault is when there's a key event with
- >the command-key down. In this case, AdjustMenus is called before
- >trying
- >to resolve the key command into a menu command. However, if there is
- >no
- >corresponding, enabled menu command you don't receive a menu event.
- >
- >To work around this, you can probably check your stored reference value
- >in your key down event handling code as well as your menu event handling
- >code.
- >
-
- How do I check for a key down event in ODF? I can't find any HandleKey, or
- KeyDown methods that I can subclass, and my DoVirtualKey method is not
- called with some command key events.
-
-
- -Neal
-